package com.fqgj.sentry.policy.server;


import com.fqgj.sentry.policy.client.RiskAntiRelationService;
import com.fqgj.sentry.policy.dao.RmRiskAntiRelationDao;
import com.fqgj.sentry.policy.entity.RmRiskAntiRelationEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by ykpbean kangping.ying@yuntu-inc.com
 *
 * @description
 * @create 2017-08-17 上午10:53
 */

@Service
public class RiskAntiRelationServiceImpl implements RiskAntiRelationService {
    @Autowired
    private RmRiskAntiRelationDao rmRiskAntiRelationDao;

    @Override
    public List<RmRiskAntiRelationEntity> getRiskRelationList() {
        return rmRiskAntiRelationDao.findAll();
    }

    @Override
    public void updateRiskAntiRelationById(RmRiskAntiRelationEntity rmRiskAntiRelationEntity) {
        rmRiskAntiRelationDao.updateByPrimaryKey(rmRiskAntiRelationEntity);
    }

    @Override
    public void saveRiskAntiRelation(RmRiskAntiRelationEntity entity) {
        rmRiskAntiRelationDao.insert(entity);
    }
}
